#      t.integer  :user_id
#      t.integer  :base_dish_id
#      t.string   :stole_by_ids  # 被谁偷过。string，用,隔开
#      t.string   :eaten_by_ids  # 被谁吃过。string，用,隔开
#      t.integer  :amount_rest   #剩余份量
#      t.integer  :level
#      t.datetime :completed_at     #完成时间。+3天为过期时间。
#      t.string   :status      # :in_the_kitchen, :sold   菜在厨房还是在桌子上
#      t.integer  :seller_id   # 默认为user_id，放在朋友架子上时为朋友的id
#      t.timestamps

class Dish < ActiveRecord::Base
   belongs_to :base_dish
   belongs_to :user

   def sold
     self.status = "sold"
     self.save!
     user = self.user
     user.money += self.base_dish.price
     user.save!
   end

   def stole(by_user)
     
   end

end
